﻿using System;
using System.Diagnostics;
using System.Linq;
using System.Collections.Generic;
using System.Web.Mvc;
using HashFoo.Rest.Server;
using HashFooRest.App.ServiceDomain.RawData;

namespace HashFooRest.App.Web.RawData
{
    public class EchoCommandHandler : Controller, IServiceHandler<EchoCommand>
    {
        /// <summary>
        /// Handles the service request.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [Authorize(Roles = "admin")]
        [IgnoreQueryMeta]
        public ResourceActionResult Handle(EchoCommand request)
        {
            Debug.WriteLine("Set echo to: " + request.EchoResult);

            return new ResourceActionResult(null);
        }
    }
}